package com.akkainaction.helloactor.demo;

import akka.actor.ActorRef;
import akka.actor.ActorSystem;
import akka.actor.Props;
import com.akkainaction.helloactor.actor.ActorDemo;

public class CreateActorByActorSystem {

    public static void main(String[] args) {
        //参数为ActorSystem的名字，可以不传
        ActorSystem system = ActorSystem.create("sys");
        //参数分别是构造器和Actor的名字，名字可以不传
        ActorRef actorRef = system.actorOf(Props.create(ActorDemo.class), "actorDemo");
    }
}
